<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>操作权限树定义</title>
</head>
<%
	String path = request.getContextPath();
	request.setAttribute("path", request.getContextPath());
	request.setAttribute("jsPath", path+"/js");
%>
<%
	if(request.getAttribute("list") == null){
		response.sendRedirect(request.getContextPath()+"/functionAuthority/get");
	}
%>
<style type="text/css">
	table{width:100%;}
	tr{text-align:center;}
</style>
<script type="text/javascript" src="${jsPath}/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="${jsPath}/global.js"></script>
<script type="text/javascript">
	$(function(){
		var msg = $("#msg").html();
		if(msg != null){
			alert(msg);
		}
		$("#totalPage").html(parseInt($("#totalPage").html()));
	});
</script>
<body>
	<c:if test="${not empty functionAuthorityVo.msg}"><p style="display:none" id="msg">${functionAuthorityVo.msg}</p></c:if>
	<form action="${path}/functionAuthority/get" method="post">
		<p>按权限名称查询权限信息
			 <input type="text" name="name"/>(支持模糊查询)
			<input type="submit" value="查找"/>
		</p>
	</form>
	<table>
		<tr>
			<th>操作权限序号</th>
			<th>名称</th>
			<th>权限检查值</th>
			<th>创建时间</th>
			<th>是否为分组</th>
			<th>操作</th>
		 </tr>
		 <c:forEach var="entity" items="${list}">
		 	<tr>
			 	<td><c:out value="${entity.functionAuthorityId}"></c:out></td>
				<td><c:out value="${entity.name}"></c:out></td>
				<td><c:out value="${entity.keyValue}"></c:out></td>
				<td><c:out value="${entity.createTime}"></c:out></td>
				<td>
					<c:if test="${entity.isgroup == 1}">分组</c:if>
					<c:if test="${entity.isgroup == 2}">节点</c:if>
				</td>
				<td>
					<a class="btn" href="${path}/functionAuthority/modifyPage?name=${entity.name}">修改</a>
					<a class="btn" href="${path}/functionAuthority/delete?name=${entity.name}">删除</a>
				</td>
		 	</tr>
		 </c:forEach>
	</table>
	<!-- 添加路径到  -->
	<script type="text/javascript">
		function formSubmit(mapping){
			var postForm = document.getElementById("excelForm");
			postForm.action = "${path}/functionAuthority/export2007";
			alert(postForm.action);
			postForm.submit();
		}
	</script>
	<p>
		<a class="btn" href="${path}/functionAuthority/addPage">添加新权限功能</a><br/><br/>
	    <a class="btn" href="${path}/functionAuthority/export">导出数据到excel表</a>
	 </p>
</body>
</html>